package com.ruoyi.system.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.CustomVisit;
import com.ruoyi.system.mapper.CustomVisitMapper;
import com.ruoyi.system.service.ICustomVisitService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * customVisitService业务层处理
 *
 * @author ruoyi
 * @date 2022-06-07
 */
@Service
public class CustomVisitServiceImpl implements ICustomVisitService
{
    @Autowired
    private CustomVisitMapper customVisitMapper;

    /**
     * 查询customVisit
     *
     * @param id customVisit主键
     * @return customVisit
     */
    @Override
    public CustomVisit selectCustomVisitById(Long id)
    {
        return customVisitMapper.selectCustomVisitById(id);
    }

    /**
     * 查询customVisit列表
     *
     * @param customVisit customVisit
     * @return customVisit
     */
    @Override
    public List<CustomVisit> selectCustomVisitList(CustomVisit customVisit)
    {
        return customVisitMapper.selectCustomVisitList(customVisit);
    }

    /**
     * 新增customVisit
     *
     * @param customVisit customVisit
     * @return 结果
     */
    @Override
    public int insertCustomVisit(CustomVisit customVisit)
    {
        customVisit.setCreateTime(DateUtils.getNowDate());
        return customVisitMapper.insertCustomVisit(customVisit);
    }

    /**
     * 修改customVisit
     *
     * @param customVisit customVisit
     * @return 结果
     */
    @Override
    public int updateCustomVisit(CustomVisit customVisit)
    {
        return customVisitMapper.updateCustomVisit(customVisit);
    }

    /**
     * 批量删除customVisit
     *
     * @param ids 需要删除的customVisit主键
     * @return 结果
     */
    @Override
    public int deleteCustomVisitByIds(Long[] ids)
    {
        return customVisitMapper.deleteCustomVisitByIds(ids);
    }

    /**
     * 删除customVisit信息
     *
     * @param id customVisit主键
     * @return 结果
     */
    @Override
    public int deleteCustomVisitById(Long id)
    {
        return customVisitMapper.deleteCustomVisitById(id);
    }
}
